<include file='./header' />
<meta http-equiv="Content-Type" content="text/html" charset="utf-8" />
<link rel="stylesheet" type="text/css" href="__ROOT__/css/zc.css"/>
<script type="text/javascript" src="__ROOT__/js/zc.js"></script>
<script type="text/javascript">
var wait=60;
$(function() {
	tabs(".zc_tab","on",".zc_con"); 
	onloadImg(".zc_body");
	
	//邀请提交 btnInviteSubmit
	$("#btnInviteSubmit").click(function(){
	    var code = $("#txtInviteCode").val();
	    //alert(code);
	    //$('.invite').hide();
	    
	    if(!$("#txtInviteCode").val()){
	        $("#spanInviteCode").show();
	        return false;}
	    
        $.ajax({  
            type: "post",  
            url: "__URL__/invitecheck",
            dataType: 'json',
            data: {code:code}, 
            beforeSend: function(XMLHttpRequest){
                //$("#spanMobile").html("<i class='fa fa-check-circle'></i>验证码已发出</span>").show();
            },  
            success: function(json){
                if(json ==1 ){
                    $('.invite').hide();
                }else {
                    //$('.invite').show();
                    $("#spanInviteCode").show();
                }
                
            } 
        })
	    })
	
	$('#txtMobile').bind('input propertychange', function() {
    	listenTxtMobile();
    });
	
	//$("#txtMobile").blur(function(){checkMobile(this,"#spanMobile","#getCode")});//手机号码格式判断	
	
	$("#txtSmsCode").blur(function(){checkConfirm1(this,"#spanConfirm1")});//验证码1格式判断
	$("#txtConfirm2").blur(function(){checkConfirm1(this,"#spanConfirm2")});//验证码2空值判断
	$("#password1").blur(function(){checkPassword(this,"#spanPassword1")});//密码1格式判断
	$("#password2").blur(function(){checkPassword(this,"#spanPassword2")});//密码2格式判断
	$("#checkAccept1").blur(function(){checkAccept(this,"#spanAccept1")});//接受协议1判断
	$("#checkAccept2").blur(function(){checkAccept(this,"#spanAccept2")});//接受协议2判断
	$("#show_password1").click(function(){swichPassword(this,"#password1")});//显示和隐藏密码1
	$("#show_password2").click(function(){swichPassword(this,"#password2")});//显示和隐藏密码2
	$("#txtEmail").blur(function(){checkEmail(this,"#spanEmail")});//eMail格式判断	
	
	//点击发送验证码按钮后倒计时且发送短信
	$("#getCode").click(function(){
		if(!checkMobile("#txtMobile","#spanMobile")){return false;}
		time($("#getCode"));//60秒倒计时
		$.ajax({  
			type: "post",  
			url: "__URL__/getCode",
			dataType: 'json',
			data: {mobile:$("#txtMobile").val(),type:'reg'}, 
			beforeSend: function(XMLHttpRequest){
				$("#spanMobile").html("<i class='fa fa-check-circle'></i>验证码已发出</span>").show();
			},  
			success: function(json){
				if(json.data > 0){
					$("#spanMobile").html("<i class='fa fa-check-circle'></i>短信发送成功</span>").show();
				}else if(json.data == -99){
					$("#spanMobile").html("<i class='fa fa-times-circle'></i>短信请求次数过多</span>").show();
				}
				else if(json.data == -3){
					$("#spanMobile").html("<i class='fa fa-times-circle'></i>您的手机号已存在</span>").show();	
				}
			} 
		})
	});
	

	
	//提交手机注册 
	$("#btnMobileReg").click(function(){     
		if(!checkMobile("#txtMobile","#spanMobile","#getCode")){return false;}//手机号码格式判断
		if(!checkConfirm1("#txtSmsCode","#spanConfirm1")){return false;}//验证码1格式判断
		if(!checkPassword("#password1","#spanPassword1")){return false;}//密码1格式判断
		if(!checkAccept("#checkAccept1","#spanAccept1")){return false;}//接受协议1判断
		$(".onload").show();
		$.ajax({  
			type: "post",  
			url: "__URL__/regOP",  
			dataType: 'json',
			data: {mobile:$("#txtMobile").val(),password:$("#password1").val(),smscode:$("#txtSmsCode").val()},
			beforeSend: function(XMLHttpRequest){   
			},  
			success: function(json){		
				if(json.data == "1"){
					window.location.href='__GROUP__/Analyse/index';
				}else{
					if(json.data=="-2"){
						$("#spanConfirm1").html("<i class='fa fa-times-circle'></i>验证码错误</span>").show();
					}else if(json.data=="-3"){
						$("#spanMobile").html("<i class='fa fa-times-circle'></i>您的手机号已存在</span>").show();	
					}else if(json.data=="-4"){
						$("#spanConfirm1").html("<i class='fa fa-times-circle'></i>验证码已失效，请重新获取</span>").show();
					}
					$(".onload").hide();
				}	
			} 
		})
	}); 
	
	//提交邮箱注册
	$('#btnEmailReg').click(function(){
		
		if(!checkEmail("#txtEmail","#spanEmail")){return false;}//邮箱地址格式判断
		if(!checkConfirm2("#txtConfirm2","#spanConfirm2")){return false;}//验证码2格式判断
		if(!checkPassword("#password2","#spanPassword2")){return false;}//密码2格式判断
		if(!checkAccept("#checkAccept2","#spanAccept2")){return false;}//接受协议2判断
		$(".onload").show();
		$.ajax({  
			type: "post",  
			url: "__URL__/regEmailOP",  
			dataType: 'json',
			data: {email:$("#txtEmail").val(),password:$("#password2").val(),code:$("#txtConfirm2").val()},
			beforeSend: function(XMLHttpRequest){   
			},  
			success: function(json){
				if(json.data == "1"){
					//邮件已发送
					//alert(json.info);
					//window.location.href='__URL__/userInfo';
					$(".onload").show();
					$(".submit_notice").show();
					$(".waiting_img").hide();
					$("#submitEmail").text($("#txtEmail").val());
				}else{
					//alert(json.info);
					$("#spanEmail").html("<i class='fa fa-times-circle'></i>"+json.info+"</span>").show();
					$(".onload").hide();
				}	
			} 
		})
	})
})      

</script>
</head>

<body>

<!--注册-->
<div class="main">
	<div class="zc_main">
    	<div class="zc_top">
        	<a href="__ROOT__/"><img src="__ROOT__/images/logo2.png" /></a>
        </div>
        <div class="zc_body" style="">
        	<!--<div class="zc_tab">
                <div class="on">手机注册</div>
                <div >邮箱注册</div>
            </div>-->
            <div class="zc_con" style="padding:0;">
                <!--手机注册-->
            	<div class="zc_con_list" style="display:block;">
                <input name="hidType" type="hidden" value="1"/>
                    <p>
                        <label>手机号码</label>
                        <input name="mobile" class="form-control w50p" placeholder="手机号码" type="text" id="txtMobile" maxlength="11">
                        <button class="btn btn-default" id="getCode" type="button" style="cursor:not-allowed;" disabled="disabled">获取验证码</button>
                        <span class="notice_wrong" style="display:none" id="spanMobile"></span>
                    </p>                    
                    <p>
                        <label>验&nbsp;证&nbsp;码</label>
                        <input name="txtCode" class="form-control w50p" placeholder="验证码" type="text" maxlength="4" id="txtSmsCode">                        
                        <span class="notice_wrong" style="display:none" id="spanConfirm1"></span>                    	
                    </p>
                    <p>
                        <label>设置密码</label>
                        <input name="password" class="form-control w60p" placeholder="长度在6-12之间，只能包含字符、数字和下划线" type="password" id="password1" maxlength="12">
                        <a class="btn btn-success btn-lg showpw" href="javascript:void(0)" id="show_password1"><i class="fa fa-eye"></i></a>
                        <span class="notice_wrong" style="display:none" id="spanPassword1"></span>
                    </p>
                    <p style="padding-left:20%;">
                        <input name="" value="" type="checkbox" id="checkAccept1" checked="checked">　我已阅读并接受<a href="provisions" target = "_blank">《7分钟用户协议》</a>
                        <span class="clear"></span>
                        <span class="notice_wrong" style="display:none" id="spanAccept1"><i class="fa fa-times-circle"></i>您还未接受7min协议</span>
                    </p>
                    <p style="padding-left:20%;position:relative;">
                        <input class="btn btn-danger" value="注 册" id="btnMobileReg" type="button">
                        <a href="login" class="btn btn-warning">已注册，去登录</a>
                    </p>
                     <p class="invite_info" style="line-height: 1.5;margin-top: 30px;text-align:center;margin-bottom:0;">7分钟理财网站华丽转身，全新出发，一切为您而变！ <br>
之前版本用户请重新注册见证我们的改变！ <br>如需查看之前版本数据，<a href="http://old.7min.com.cn" target="_blank">请点击这里>></a></p>
                </div>
                <!--邮箱注册
                <div class="zc_con_list">
                <input name="hidType" type="hidden" value="2"/>
                    <p>
                        <label>邮箱地址</label>
                        <input name="email" class="form-control w70p" placeholder="邮箱地址" type="text" id="txtEmail">
                        <span class="notice_wrong" style="display:none" id="spanEmail"></span>
                    </p>
                    <p>
                        <label>设置密码</label>
                        <input name="password" class="form-control w60p" placeholder="长度在6-12之间，只能包含字符、数字和下划线" type="password" id="password2" maxlength="12">
                        <a class="btn btn-success btn-lg showpw" href="javascript:void(0)" id="show_password2"><i class="fa fa-eye"></i></a>
                        <span class="notice_wrong" style="display:none" id="spanPassword2"></span>
                    </p>
                    <p>
                        <label>验&nbsp;证&nbsp;码</label>
                        <input name="txtCode" class="form-control w50p" placeholder="验证码" type="text" id="txtConfirm2">
                        <img class="pass-verifyCode" title="验证码图片" alt="验证码图片"  src="verify" onClick="this.src='verify?nocache='+Math.random()" />
                        <span class="notice_wrong" style="display:none" id="spanConfirm2"></span>
                    </p>
                    <p style="padding-left:20%;">
                        <input name="" value="" type="checkbox" id="checkAccept2" checked="checked">　我已阅读并接受<a href="#" target="_blank">《7min用户协议》</a>
                        <div class="clear"></div>
                        <span class="notice_wrong" style="display:none" id="spanAccept2"><i class="fa fa-times-circle"></i>您还未接受7min协议</span>
                    </p>
                    <p style="padding-left:20%;position:relative;">
                        <input class="btn btn-danger" value="注 册" id="btnEmailReg" type="button">
                        <a href="login" class="btn btn-warning">已注册，去登录</a>
                    </p>   
                </div>-->
            </div>
            <div class="clear"></div>
        </div>
        <!--邀请码-->
        <div class="invite">
			<p class="invite_info">（网站正在升级中）7分钟理财机器人微信版上线了！关注7分钟理财微信号就能用！配置资产，评测产品，追踪收益，买卖提醒……更能通过微信或电话，免费咨询理财问题！    
            </p>
            <div class="invite_way">
                <div class="invite01" style="text-align:center;">
                    <h1>1、微信扫一扫</h1>
                    <div class="invite_code"><img src="__ROOT__/images/QR_Code.jpg" /></div>
                    <p>关注并进入官方微信号</p>
                </div>

            </div>
            <div class="clear"></div>
            <div class="invite_form"  style="text-align:center;">
            	<p>
                        <!--<label>邀请码：</label>
                        <input name="mobile" class="form-control" style="width:40%" placeholder="输入您的邀请码" type="text" id="txtInviteCode" maxlength="6">-->
                        <br>

                        <button class="btn btn-danger btn-sm" id="btnInviteSubmit" type="button" >马上注册</button>&nbsp;
                        <a href="login" class="btn btn-success">已注册去登录</a>
                        <br>
                        <span class="notice_wrong" id="spanInviteCode" style="display:none"><i class="fa fa-times-circle"></i>您的邀请码输入错误</span>
                    </p>
            </div>
	
        </div>
        <!--加载中-->
        <div class="onload" style="display:none">
            <div class="waiting_img"  style="">
            	<img src="__ROOT__/images/onload.gif" />
            </div>
            <div class="submit_notice" style="display:none">
            	邮件已发送，请登录您的邮箱<span id="submitEmail" class="text text-danger"></span>查收激活。
            </div>
        </div>
    </div>
    </div>
</div>
</body>
</html>
